import { RouteRecordRaw } from 'vue-router'
import { AttachMoneyRound, SettingsSuggestRound, AddChartRound, BadgeSharp } from '@vicons/material'
import { renderIcon } from '@/util'
import { FileInvoiceDollar } from '@vicons/fa'
import { TransactionOutlined } from '@vicons/antd'

declare module 'vue-router' {
    interface RouteMeta {
        title?: string
        role?: string
        icon?: any
        sort?: number
        real?: boolean
    }
}

const routes: Array<RouteRecordRaw> = [
    {
        path: '/fin',
        name: 'fin',
        redirect: '/fin/income',
        component: () => import('@/views/layout/Index.vue'),
        meta: {
            title: '财务管理',
            icon: renderIcon(AttachMoneyRound),
            role: 'Adm',
            sort: 3,
        },
        children: [
            {
                path: 'income',
                name: 'fin.income',
                meta: {
                    title: '平台收益',
                    icon: renderIcon(AddChartRound),
                    role: 'Adm',
                },
                component: () => import('@/views/fin/income/Index.vue'),
            },
            {
                path: 'withdraw',
                name: 'fin.withdraw',
                meta: {
                    title: '提现信息',
                    icon: renderIcon(BadgeSharp),
                    role: 'Adm',
                },
                component: () => import('@/views/fin/withdraw/Index.vue'),
            },
            {
                path: 'invoice',
                name: 'fin.invoice',
                meta: {
                    title: '发票信息',
                    icon: renderIcon(FileInvoiceDollar),
                    role: 'Adm',
                },
                component: () => import('@/views/fin/invoice/Index.vue'),
            },
            {
                path: 'payment',
                name: 'fin.payment',
                meta: {
                    title: '收款信息',
                    icon: renderIcon(TransactionOutlined),
                    role: 'Adm',
                },
                component: () => import('@/views/fin/payment/Index.vue'),
            },
            {
                path: 'refund',
                name: 'fin.refund',
                meta: {
                    title: '退款信息',
                    icon: renderIcon(TransactionOutlined),
                    role: 'Adm',
                },
                component: () => import('@/views/fin/refund/Index.vue'),
            },
        ],
    },
]

export default routes
